﻿using System;
using System.Collections.Generic;

namespace SystemX
{
	public static partial class ObjectX
	{
		/// <summary>
		/// Whether a object is its default state.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="val"></param>
		/// <returns></returns>
		public static bool IsDefault<T>(this T val)
		{
			return EqualityComparer<T>.Default.Equals(val, default(T));
		}
	}
}
